package zhjb.temp.db;

import java.sql.Connection;

/**
 * DB子模块dao的门面
 * @author zhangjianbing@msn.com
 * 
 */
public class DataBaseDaoFacade {
	public Connection getConnection() {
		return DaoContext.getConnection();
	}

	/**
	 * 添加一条数据
	 * 
	 * @param obj
	 * @throws Exception
	 */
	public void add(Object obj) throws Exception {
		DaoContext.getDao().add(obj, getConnection());
	}

	/**
	 * 根据主键获取一条数据
	 * 
	 * @param pk
	 * @return
	 * @throws Exception
	 */
	public Object getByPK(String pk, Class clazz) throws Exception {
		return DaoContext.getDao().getByPK(pk, clazz, getConnection());
	}
}
